import java.math.BigDecimal;
 
public class Deneme {
 
      public static BigDecimal calculateTermAmount(BigDecimal topTaksitTutari,
                  short topTaksitSayisi) {
 
            BigDecimal taksitSayisi = new BigDecimal(topTaksitSayisi);
            BigDecimal termAmount = new BigDecimal(0);
 
            try {
                  if (taksitSayisi.intValue() > 0) {
                        termAmount = topTaksitTutari.divide(taksitSayisi, 2, BigDecimal.ROUND_DOWN);
                  } 
            } catch (Exception e) {
                  System.out.println(e);
            }
            return termAmount;
      }
      
      public static void main(String[] args) {
            short s = 12;
            BigDecimal decimal = calculateTermAmount(new BigDecimal(5000), s);
            System.out.println(decimal);
      }
 
}
